import request from "@/utils/request";

// 查询门票产品列表
export function listTicket(query) {
  return request({
    url: "/system/ticket/list",
    method: "get",
    params: query,
  });
}

// 查询门票产品详细
export function getTicket(id) {
  return request({
    url: "/system/ticket/" + id,
    method: "get",
  });
}

// 新增门票产品
export function addTicket(data) {
  return request({
    url: "/system/ticket",
    method: "post",
    data: data,
  });
}

// 修改门票产品
export function updateTicket(data) {
  return request({
    url: "/system/ticket",
    method: "put",
    data: data,
  });
}

// 删除门票产品
export function delTicket(id) {
  return request({
    url: "/system/ticket/" + id,
    method: "delete",
  });
}

// 加入购物车API
export function addToCart(data) {
  return request({
    url: '/system/ticket/addToCart',
    method: 'post',
    data: data
  });
}
